import java.util.HashMap;
import java.util.Map;


public class Calculator {

	Map<String, String> kv;
	
	Calculator(){
		 kv =  new HashMap<String, String>();
	}
	
	public String[] resolve(String s){
		try{
			String[] sa = new String[3];
			sa = s.split(" ");
			return sa;
		}
		catch(NumberFormatException n){
			System.out.println("The input was not properly formatted, please try again.");
			return null;
		}
	}

	public void calculate(String[] sa){

		if(!isVariable(sa)){

			double n1 = Integer.parseInt(sa[0]);
			double n2 = Integer.parseInt(sa[2]);

			if(sa[1].equals("+")){
				System.out.println(n1+n2);
			}
			else if(sa[1].equals("-")){
				System.out.println(n1-n2);
			}
			else if(sa[1].equals("*")){
				System.out.println(n1*n2);
			}
			else if(sa[1].equals("/")){
				System.out.println(n1/n2);
			}
			else if(sa[1].equals("%")){
				System.out.println(n1%n2);
			}
		}

		else if(isVariable(sa) && sa[1] == "="){

			kv.put(sa[0], sa[2]);
		}
		else if(isVariable(sa) && sa[1] != "="){
			
			for(int i = 0; i < 3; i++){
				kv.containsKey(sa[i]);   
			}			
		}
	}
	public boolean isVariable(String[] sa){
		try{
			Integer.parseInt(sa[0]);
			Integer.parseInt(sa[2]);
			return false;
		}catch(NumberFormatException n){
			return true;
		}
	}
}
